package com.anjoyo.anjoyosafety.util;

/**
 * 
 * @author Dell
 * 
 */
public class StringUtil
{
	/**
	 * 
	 * @param s
	 * @return
	 */
	public static boolean isNotEmpty(String s)
	{
		return s != null && !"".equals(s.trim());
	}

	/**
	 * 
	 * @param s
	 * @return
	 */
	public static boolean isEmpty(String s)
	{
		return s == null || "".equals(s.trim());
	}

	/**
	 * 
	 * @param src
	 * @param objects
	 * @return
	 */
	public static String format(String src, Object... objects)
	{
		int k = 0;
		for (Object obj : objects)
		{
			src = src.replace("{" + k + "}", obj.toString());
			k++;
		}
		return src;
	}
}
